package com.spring.boot;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

/**
 * @author Spring King
 * @date 2021/7/5
 */
public class SpringApplication {

    public static void run(Class<?> applicationClass, String[] args) {
        Tomcat tomcat = new Tomcat();
        try {
            tomcat.addWebapp("/", "D:\\");
            tomcat.start();
            tomcat.getServer().await();
        } catch (LifecycleException | ServletException e) {
            e.printStackTrace();
        }
    }
}
